<#import "template.ftl" as layout>
<@layout.registrationLayout; section>
    <#if section = "form">
        <div class="errormsg">${errorMessage!""}</div>
        <form id="kc-totp-login-form" class="${properties.kcFormClass!} " action="${url.loginAction}" method="post">
            <div class="form-groups">
                <div class="from-label">
                    <label for="phoneNumber"
                           class="${properties.kcLabelClass!}">${msg("enterPhoneNumberMessage")}</label>
                </div>

                <div class="">
                    <input id="phoneNumber" name="phoneNumber" type="text" value="${phoneNumber!""}" class="form-controls"/>
                </div>
            </div>
            <#if status?? && status>
                <div class="form-groups">
                    <div  class="from-label">
                        <label for="totp" class="${properties.kcLabelClass!}">${msg("verifySMSCodeTopMessage")}</label>
                    </div>
                    <div>
                        <input id="totp" name="smsCode" type="text" class="form-controls"/>
                    </div>
                </div>
            </#if>
            <div class="${properties.kcFormGroupClass!}">
                <div id="kc-form-options" class="${properties.kcFormOptionsClass!}">
                    <div class="${properties.kcFormOptionsWrapperClass!}">
                    </div>
                </div>

                <div id="kc-form-buttons" class="${properties.kcFormButtonsClass!}">
                    <div class="${properties.kcFormButtonsWrapperClass!} SubmitButton">
                        <#if status?? && status>
                            <input class="button cancel-color"
                                   name="cancel" id="kc-cancel" type="submit" value="${msg("doCancel")}"/>
                            <input class="button default-color"
                                   name="login" id="kc-login" type="submit" value="${msg("doLogIn")}"/>
                        </#if>
                        <#if status?? && !status>
                            <input class="button default-color"
                                   name="sendCode" id="kc-sendCode" type="submit" value="发送验证码"/>
                        </#if>
                    </div>
                </div>
            </div>
        </form>
        <#if client?? && client.baseUrl?has_content>
            <p><a id="backToApplication" href="${client.baseUrl}">${msg("backToLoginForm")}</a></p>
        </#if>
    </#if>
</@layout.registrationLayout>
